home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 December / 1989-12.d64 / disk inventory (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  86 lines

  1. 10 rem copyright 1989 compute! publications, inc. - all rights reserved
  2. 20 poke53280,0:poke53281,0:print"[147][158]"
  3. 30 printtab(10)"                    "
  4. 40 printtab(10)"   disk inventory   "
  5. 50 printtab(10)"                    "
  6. 60 print"  1)  inventory all files"
  7. 70 print"  2)  inventory 'prg' files only"
  8. 80 print"  3)  inventory 'seq' files only"
  9. 90 print" insert first disk and make selection"
  10. 100 geta$:ifa$=""then100
  11. 110 ifa$<"1"ora$>"3"then100
  12. 120 b$="$"
  13. 130 ifa$="2"thenb$="$:*=p"
  14. 140 ifa$="3"thenb$="$:*=s"
  15. 150 dimr$(500):current=0
  16. 160 open15,8,15:open1,8,0,b$
  17. 170 print"[147]":print"  filename    type   disk name"
  18. 180 print"[195][195][195][195][195][195][195][195][195][195][195][195][195] [195][195][195][195] [195][195][195][195][195][195][195][195][195][195][195][195][195][158]"
  19. 190 get#1,d$,d$,d$,d$,d$,d$,d$,d$
  20. 200 dn$=""
  21. 210 fori=1to16:get#1,x$:dn$=dn$+x$:nexti
  22. 220 get#1,d$,d$,d$,d$,d$,d$,d$,d$
  23. 230 get#1,d$,d$,l$,d$,e$
  24. 240 ife$="b"then350
  25. 250 get#1,x$:ifx$<>chr$(34)then250
  26. 260 n$=""
  27. 270 get#1,x$:ifx$<>chr$(34)thenn$=n$+x$:goto270
  28. 280 get#1,d$:ifd$=" "then280
  29. 290 t$=d$:get#1,d$,d$
  30. 300 fori=len(n$)to16:n$=n$+chr$(32):nexti
  31. 310 r$(current)=n$+t$+chr$(32)+dn$
  32. 320 printr$(current):current=current+1
  33. 330 get#1,d$:ifd$=" "then330
  34. 340 goto230
  35. 350 print:print"insert next disk or press a key to stop"
  36. 360 q=16:gosub410:rem being removed?
  37. 370 q=0:gosub410:rem fully removed?
  38. 380 q=16:gosub410:rem being inserted?
  39. 390 q=0:gosub410:rem fully inserted?
  40. 400 close1:close15:goto160:rem read next disk
  41. 410 getw$:ifw$<>""then480
  42. 420 print#15,"m-r"chr$(30)chr$(0)
  43. 430 get#15,z$:ifz$=""thenz$=chr$(0)
  44. 440 ifasc(z$)=qthen410
  45. 450 return
  46. 460 print"[147] disk error: "en$;" "em$;" "et$;" "es$
  47. 470 close15:end
  48. 480 print"[147] select: [158]":print:print:print
  49. 490 print" 1) sort by filename":print
  50. 500 print" 2) save as an ascii file":print
  51. 510 print" 3) display to screen"
  52. 520 print"    (use <ctrl> to slow listing)":print
  53. 530 print" 4) print list":print
  54. 540 print" 5) exit":print
  55. 550 getd$:ifd$=""then550
  56. 560 ifd$<"1"ord$>"5"then550
  57. 570 d=val(d$):on d goto660,750,590,810,580
  58. 580 close15:end
  59. 590 print"[147]":print"  filename      type   disk name"
  60. 600 print"[195][195][195][195][195][195][195][195][195][195][195][195][195] [195][195][195][195] [195][195][195][195][195][195][195][195][195][195][195][195][195][158]"
  61. 610 for i=1tocurrent:printr$(i):nexti
  62. 620 print:print" end (press any key)"
  63. 630 getd$:ifd$=""then630
  64. 640 goto480
  65. 650 rem *** sort routine ***
  66. 660 print"[147][159]sorting..."
  67. 670 m=current-1
  68. 680 m=int(m/2):ifm=0then480
  69. 690 j=0:k=current-1-m
  70. 700 i=j
  71. 710 l=i+m
  72. 720 if r$(i)>r$(l)thent$=r$(i):r$(i)=r$(l):r$(l)=t$:i=i-m:ifi>0then710
  73. 730 j=j+1:ifj>kthen680
  74. 740 goto700
  75. 750 input"[147]filename ";n$:n$=left$(n$,16)
  76. 760 open2,8,8,"0:"+n$+",s,w"
  77. 770 print#2,"  filename    type   disk name"
  78. 780 print#2,"------------- ---- -------------"
  79. 790 for i=1tocurrent:print#2,r$(i):nexti
  80. 800 print#2:close2:goto480
  81. 810 open4,4:cmd4
  82. 820 print#4,"  filename    type   disk name"
  83. 830 print#4,"------------- ---- -------------"
  84. 840 for i=1tocurrent:print#4,r$(i):nexti
  85. 850 print#4:close4:goto480
  86.